package com.bw.ppjoke;

import android.os.Bundle;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import java.util.ArrayList;
import java.util.List;

public class MoreActivity extends AppCompatActivity {

    private RecyclerView more_rv;
    private MoreAdapter adapter;
    private List<MoreEntity>list = new ArrayList<>();

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_more);
        init();
        initData();
        adapter.setNewInstance(list);
    }

    private void init(){
        more_rv = findViewById(R.id.more_rv);
        LinearLayoutManager manager = new LinearLayoutManager(this);
        manager.setOrientation(LinearLayoutManager.VERTICAL);
        more_rv.setLayoutManager(manager);
        adapter = new MoreAdapter();
        more_rv.setAdapter(adapter);
    }

    private void initData(){
        for (int i = 0;i < 30;i ++){
            list.add(new MoreEntity("title:"+i,"value:"+i,(i%2>0?1:0)));
        }

    }


}
